/*
Pow(x, n)
Implement pow(x, n).

*/
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>

using namespace std;

class Solution {
public:
	double mypow(double x, int n)
	{
		if(n == 0)
			return 1;
		double result;
		
		result = mypow(x,n/2);
		
		if(n%2 == 0)
			return result *result;
		else
			return result*result*x;
		
	}
    double pow(double x, int n) {
        if(n<0)
			return 1.0/mypow(x,-n);
		else
			return mypow(x,n);
    }
};


class Solution1 {
public:
	double mypow(double x, int n)
	{
		if(n == 0)
			return 1;
		else
		{
			--n;
			return x * mypow(x,n); 
		}
		
	}
    double pow(double x, int n) {
        double result;
		if(x == 0 || n == 0)
			return 1;
		else if(n > 0)
		{
			result = mypow(x,n);
		}
		else{
			result = 1.0 / mypow(x,abs(n));
		}
		return result;
    }
};

int main(int argc, char* argv[])
{
	cout<<"Pow(x,n)"<<endl;
	
	cout<<"Input X, n"<<endl;
	
	double x, result;
	int n;
	
	cin>>x>>n;
	
	
	Solution s;
	result = s.pow(x,n);
	
	cout<<"The result of ("<<x<<","<<n<<") is : " <<result<<endl;
	
	
	return 0;
}